<%@page import="org.slf4j.LoggerFactory"%>
<%@page import="org.slf4j.Logger"%>
<%@page import="java.io.PrintWriter"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" isErrorPage="true"%>
<%@ include file="/pages/common/header.jsp"%>
<%
	if (exception == null){
		exception = (Exception) request.getAttribute("javax.servlet.error.exception");
		if(exception==null){
			exception = (Exception) session.getAttribute("javax.servlet.jsp.jspException");
			session.removeAttribute("javax.servlet.jsp.jspException");
		}
	}
	//记录日志
	Logger logger = LoggerFactory.getLogger("500.jsp");
	logger.error(exception.getMessage(), exception);
%>
	<title>出错了！</title>
</head>
<body>
	<body class="contentBody contentborder" style="width: 95%;overflow: scroll;background-color: white;">
		<table id="err_table" align="center" cellspacing='0' cellpadding='0' border=0>
			<tr>
				<td valign="middle" align="center">
					<img src="<jdf:theme/>images/warning.gif">
					<button type="button" onclick="if (detail_error_msg.style.display == 'none'){detail_error_msg.style.display = '';parent.iframeAutoFit();}else{detail_error_msg.style.display = 'none';}">详细信息</button>
					<button type="button" onclick="javascript:history.go(-1);">返回</button>
				</td>
			</tr>
			<tr height=30 bgcolor="f4f4f4">
				<td>
					<b>出现问题： </b> <SPAN><%=exception!=null?exception.getMessage():"未知原因"%></SPAN>
				</td>	
			</tr>
			<tr>
				<td>
					<div id="detail_error_msg" style="display:none;">
						<pre>
						<%
							while(exception != null){
								exception.printStackTrace(new PrintWriter(out));
								if (exception instanceof JspException){
							      exception = ((JspException) exception).getRootCause();
							    }else if (exception instanceof ServletException){
							      exception = ((ServletException) exception).getRootCause();
							    }else {
							    	exception = exception.getCause();
							    }
							}
						%>
						</pre>
					</div>
				</td>
			</tr>
		</table>
	</body>
</html>
